<!doctype html>
<html>
<body>
    <div style="display:flex;align-items:center;">
        <img src="../../data/test_sunrise.jpg" id="sunrise_img" width="20%">
        <img src="../../data/arrow.svg" width="15%">
        <canvas id="target_img1"></canvas>
    </div>
    <br>
    <div style="display:flex;align-items:center;">
        <img src="../../data/test_sunrise.jpg" width="20%">
        <img src="../../data/arrow.svg" width="15%">
        <canvas id="target_img2"></canvas>
    </div>

    <script src="../../../flycv.js" type="text/javascript"></script>
    <script type="text/javascript">
        fcv.then((fcv) => {
            // 读取图像，构造mat数据
            let src = fcv.imread("sunrise_img");

            let dstX = new fcv.Mat();
            let dstY = new fcv.Mat();
            fcv.flip(src, dstX, fcv.FlipType.X);
            fcv.flip(src, dstY, fcv.FlipType.Y);

            // 可视化
            fcv.imshow("target_img1", dstX);
            fcv.imshow("target_img2", dstY);

            // 内存回收
            src.delete();
            dstX.delete();
            dstY.delete();
        });
    </script>
</body>
</html>